<!--
 * @Author: 张久冬
 * @Date: 2022-01-12 21:48:48
 * @
# Description:
-->
<template>
  <div class="pieEcharts">
    <baseEchart :options="options"></baseEchart>
  </div>
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue'
import baseEchart from '@/base-ui/echarts'

export default defineComponent({
  props: {
    pieData: {
      type: Object,
      required: true
    }
  },
  components: { baseEchart },
  setup(props) {
    const options = computed(() => ({
      tooltip: {
        trigger: 'item'
      },
      legend: {
        orient: 'horizontal',
        left: 'left'
      },
      series: [
        {
          name: '分类数据',
          type: 'pie',
          radius: '50%',
          data: props.pieData,
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: 'rgba(0, 0, 0, 0.5)'
            }
          }
        }
      ]
    }))
    return { options }
  }
})
</script>

<style scoped></style>
